<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${wxPortURl!}/"/>
    <meta charset="UTF-8">
    <meta name="referrer" content="no-referrer"/>
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
    <title>漠河智慧社区</title>
    <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
    <!--  <link href="css/index.css" rel="stylesheet" type="text/css">-->
    <link href="Content/wechat/css/zhiYuanZhe_fc.css" rel="stylesheet" type="text/css">

    <script src="Content/wechat/js/jquery.min.js"></script>
    <!--字体缩放-->
    <script src="Content/wechat/js/ziti.js"></script>
    <!--end 字体缩放-->
    <!--页码js-->
    <script src="Content/wechat/js/myPagination.js"></script>
    <!--页码-->
    <link href="Content/wechat/css/myPagination.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
    <img src="Content/wechat/images/zxkf.png?1">
</header>

<div class="dianLiang_list">
    <div class="dianLiang_list_box">
        <!--        <a href="">-->
        <!--            <img src="Content/wechat/images/photo.jpg">-->
        <!--            <span>西铁社区</span>-->
        <!--            <span style="color: #009DFF">156-4550-8595</span>-->
        <!--        </a>-->
        <!--        <a href="#">-->
        <!--            <img src="Content/wechat/images/photo.jpg">-->
        <!--            <span>西铁社区</span>-->
        <!--            <span style="color: #009DFF">156-4550-8595</span>-->
        <!--        </a>-->

    </div>
</div>

<script>
    window.onload = function () {
        var json =${KEFU!};
        var insetViewData = ""; //视图数据
        for (var i = 0, l = json.length; i < l; i++) {
            if (json[i].status == "1") {
                insetViewData += " <a onclick='connKf(\"" + json[i].kf_account + "\",\"" + json[i].kf_nick + "\")'>\n" +
                    "            <img src=\"" + json[i].kf_headimgurl + "\">\n" +
                    "            <span>" + json[i].kf_nick + "</span>\n" +
                    "            <span style=\"color: #009DFF\">在线</span>\n" +
                    "        </a>";
            } else {
                insetViewData += " <a onclick='Kf()'>\n" +
                    "            <img src=\"" + json[i].kf_headimgurl + "\">\n" +
                    "            <span>" + json[i].kf_nick + "</span>\n" +
                    "            <span style=\"color: red\">不在线</span>\n" +
                    "        </a>";

            }

        }
        $(".dianLiang_list_box").html(insetViewData);
    }

    function connKf(kf_account, kf_nick) {
        $.ajax({
            url: "/wechat/onlineservice_connect",
            type: 'post',
            dataType: 'json',
            data: {
                kf_account: kf_account, kf_nick: kf_nick
            }, success: function (result) {
                if (result.info == '0') {
                    alert("点击关闭，此页面将回到客服对话界面中!");
                    WeixinJSBridge.invoke("closeWindow", {}, function (e) {
                    });
                } else {
                    alert(result.info);
                }
            }, error: function (data) {
                alert("客服系统异常，请稍后再试！");
            }

        })
    }

    function Kf() {
        alert("当前客服不在线");
    }

</script>
<!--页尾-->
<script type="text/javascript" src="Content/wechat/js/foot.js"></script>


</body>

</html>